import { Map } from "immutable";
import { CHANGE_NOTE_LIST, CHANGE_USER_LIST } from "./constant";

const initState = Map({
  noteList: [],
  userList: [],
});
export default function reducer(state = initState, { type, data }) {
  switch (type) {
    case CHANGE_USER_LIST:
      return state.set("userList", data);
    case CHANGE_NOTE_LIST:
      return state.set("noteList", data);
    default:
      return state;
  }
}
